
const { BrowserWindow } = require('@electron/remote')
var btn = document.getElementById('btn')

btn.onclick = function() {
  // const BrowserWindow = require('electron').remote.BrowserWindow;
  let win = new BrowserWindow({
    width: 400,
    height: 300
  })
  win.loadFile('child.html')
  win.on('close', () => {
    win = null
  })
}

var btn2 = document.getElementById('btn-child')
btn2.onclick = function() {
  window.open('./child.html')
}